/*
 * This file is part of the libopencm3 project.
 *
 * Copyright (C) 2014 Chuck McManis <cmcmanis@mcmanis.com>
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MCMFONT_INC
#define MCMFONT_INC

/* Ascii 7 x 12 font
 *
 * This is a pretty generic 7 x 12 ASCII font that includes lower case
 * descenders (indicated by (data & 0x80) != 0 on the first data byte of the
 * character. Each row represents 9 "lines" of the font, the bits in the byte
 * represent columns. When a glyph descends below the base line it is rendered
 * 3 pixels lower (hence the height of 12 pixels rather than 9 even though the
 * data is only 9 rows tall)
 */

#define FONT_CHAR_WIDTH 7
#define FONT_CHAR_HEIGHT 12

static const unsigned char mcm_font[] = {
	0x00, 0x00, 0x00, 0x00, 0x31, 0x4A, 0x44, 0x4A, 0x31,   /* 0 */
	0xBC, 0x22, 0x3B, 0x22, 0x22, 0x3b, 0x20, 0x20, 0x40,   /* 1 */
	0x80, 0x61, 0x12, 0x14, 0x18, 0x10, 0x30, 0x30, 0x30,   /* 2 */
	0x30, 0x48, 0x40, 0x40, 0x20, 0x30, 0x48, 0x48, 0x30,   /* 3 */
	0x00, 0x00, 0x18, 0x20, 0x40, 0x78, 0x40, 0x20, 0x30,   /* 4 */
	0x16, 0x0e, 0x10, 0x20, 0x40, 0x40, 0x38, 0x04, 0x18,   /* 5 */
	0x80, 0x2c, 0x52, 0x12, 0x12, 0x12, 0x02, 0x02, 0x02,   /* 6 */
	0x18, 0x24, 0x42, 0x42, 0x3e, 0x42, 0x42, 0x24, 0x18,   /* 7 */
	0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x48, 0x30,   /* 8 */
	0x00, 0x00, 0x40, 0x48, 0x50, 0x60, 0x50, 0x4A, 0x44,   /* 9 */
	0x40, 0x20, 0x10, 0x10, 0x10, 0x10, 0x18, 0x24, 0x42,   /* 10 */
	0x80, 0x48, 0x48, 0x48, 0x48, 0x74, 0x40, 0x40, 0x40,   /* 11 */
	0x00, 0x00, 0x00, 0x62, 0x22, 0x24, 0x28, 0x30, 0x20,   /* 12 */
	0x08, 0x1c, 0x20, 0x18, 0x20, 0x40, 0x3c, 0x02, 0x0c,   /* 13 */
	0x00, 0x00, 0x00, 0x18, 0x24, 0x42, 0x42, 0x24, 0x18,   /* 14 */
	0x00, 0x00, 0x00, 0x3f, 0x54, 0x24, 0x24, 0x24, 0x24,   /* 15 */

	0x98, 0x24, 0x42, 0x42, 0x64, 0x58, 0x40, 0x40, 0x40,   /* 16 */
	0x00, 0x00, 0x00, 0x1f, 0x24, 0x42, 0x42, 0x24, 0x18,   /* 17 */
	0x00, 0x00, 0x00, 0x3f, 0x48, 0x08, 0x08, 0x08, 0x08,   /* 18 */
	0x00, 0x00, 0x00, 0x62, 0x24, 0x24, 0x24, 0x24, 0x18,   /* 19 */
	0x10, 0x10, 0x38, 0x54, 0x54, 0x54, 0x38, 0x10, 0x10,   /* 20 */
	0x00, 0x00, 0x00, 0x00, 0x62, 0x14, 0x08, 0x14, 0x23,   /* 21 */
	0x80, 0x49, 0x2a, 0x2a, 0x2a, 0x1c, 0x08, 0x08, 0x08,   /* 22 */
	0x00, 0x00, 0x00, 0x22, 0x41, 0x49, 0x49, 0x49, 0x36,   /* 23 */
	0x00, 0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x22, 0x63,   /* 24 */
	0x0f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x50, 0x30, 0x10,   /* 25 */
	0x00, 0x00, 0x04, 0x02, 0x7f, 0x02, 0x04, 0x00, 0x00,   /* 26 */
	0x00, 0x00, 0x10, 0x20, 0x7f, 0x20, 0x10, 0x00, 0x00,   /* 27 */
	0x08, 0x1c, 0x2a, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,   /* 28 */
	0x00, 0x00, 0x08, 0x00, 0x7f, 0x00, 0x08, 0x00, 0x00,   /* 29 */
	0x7f, 0x20, 0x10, 0x08, 0x06, 0x08, 0x10, 0x20, 0x7f,   /* 30 */
	0x00, 0x30, 0x45, 0x06, 0x30, 0x45, 0x06, 0x00, 0x00,   /* 31 */

	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 32 */
	0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x08,   /* 33 */
	0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 34 */
	0x14, 0x14, 0x14, 0x7f, 0x14, 0x7f, 0x14, 0x14, 0x14,   /* 35 */
	0x08, 0x3f, 0x48, 0x48, 0x3e, 0x09, 0x09, 0x7e, 0x08,   /* 36 */
	0x20, 0x51, 0x22, 0x04, 0x08, 0x10, 0x22, 0x45, 0x02,   /* 37 */
	0x38, 0x44, 0x44, 0x28, 0x10, 0x29, 0x46, 0x46, 0x39,   /* 38 */
	0x20, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 39 */
	0x08, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x08,   /* 40 */
	0x08, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04, 0x08,   /* 41 */
	0x80, 0x49, 0x2a, 0x1c, 0x7f, 0x1c, 0x2a, 0x49, 0x80,   /* 42 */
	0x00, 0x80, 0x80, 0x80, 0x7e, 0x80, 0x80, 0x80, 0x00,   /* 43 */
	0x80, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x10, 0x20,   /* 44 */
	0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00,   /* 45 */
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,   /* 46 */
	0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00,   /* 47 */

	0x3e, 0x41, 0x43, 0x45, 0x49, 0x51, 0x61, 0x41, 0x3e,   /* 48 */
	0x08, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3e,   /* 49 */
	0x3e, 0x41, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x40, 0x7f,   /* 50 */
	0x3e, 0x41, 0x01, 0x01, 0x1e, 0x01, 0x01, 0x41, 0x3e,   /* 51 */
	0x02, 0x06, 0x0a, 0x12, 0x22, 0x7f, 0x02, 0x02, 0x02,   /* 52 */
	0x7f, 0x40, 0x40, 0x40, 0x7e, 0x01, 0x01, 0x41, 0x3e,   /* 53 */
	0x3e, 0x41, 0x40, 0x40, 0x7e, 0x41, 0x41, 0x41, 0x3e,   /* 54 */
	0x7f, 0x41, 0x02, 0x04, 0x08, 0x10, 0x10, 0x10, 0x10,   /* 55 */
	0x3e, 0x41, 0x41, 0x41, 0x3e, 0x41, 0x41, 0x41, 0x3e,   /* 56 */
	0x3f, 0x41, 0x41, 0x41, 0x3f, 0x01, 0x01, 0x41, 0x3e,   /* 57 */
	0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,   /* 58 */
	0xa0, 0x00, 0x00, 0x00, 0x00, 0x30, 0x10, 0x10, 0x20,   /* 59 */
	0x04, 0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x04,   /* 60 */
	0x00, 0x00, 0x00, 0x7f, 0x00, 0x7f, 0x00, 0x00, 0x00,   /* 61 */
	0x10, 0x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08, 0x10,   /* 62 */
	0x3e, 0x41, 0x41, 0x02, 0x04, 0x08, 0x08, 0x00, 0x08,   /* 63 */

	0x3e, 0x41, 0x41, 0x1d, 0x55, 0x5e, 0x40, 0x40, 0x3e,   /* 64 */
	0x1c, 0x22, 0x41, 0x41, 0x7f, 0x41, 0x41, 0x41, 0x41,   /* 65 */
	0x7e, 0x21, 0x21, 0x21, 0x3e, 0x21, 0x21, 0x21, 0x7e,   /* 66 */
	0x1e, 0x21, 0x40, 0x40, 0x40, 0x40, 0x40, 0x21, 0x1e,   /* 67 */
	0x7e, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x7e,   /* 68 */
	0x7f, 0x40, 0x40, 0x40, 0x78, 0x40, 0x40, 0x40, 0x7f,   /* 69 */
	0x7f, 0x40, 0x40, 0x40, 0x78, 0x40, 0x40, 0x40, 0x40,   /* 70 */
	0x1e, 0x21, 0x40, 0x40, 0x40, 0x47, 0x41, 0x21, 0x1e,   /* 71 */
	0x41, 0x41, 0x41, 0x41, 0x7f, 0x41, 0x41, 0x41, 0x41,   /* 72 */
	0x3e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3e,   /* 73 */
	0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38,   /* 74 */
	0x41, 0x42, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, 0x41,   /* 75 */
	0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7f,   /* 76 */
	0x41, 0x63, 0x55, 0x49, 0x49, 0x41, 0x41, 0x41, 0x41,   /* 77 */
	0x41, 0x61, 0x51, 0x49, 0x45, 0x43, 0x41, 0x41, 0x41,   /* 78 */
	0x1c, 0x22, 0x41, 0x41, 0x41, 0x41, 0x41, 0x22, 0x1c,   /* 79 */

	0x7e, 0x41, 0x41, 0x41, 0x7e, 0x40, 0x40, 0x40, 0x40,   /* 80 */
	0x1c, 0x22, 0x41, 0x41, 0x41, 0x41, 0x45, 0x22, 0x1d,   /* 81 */
	0x7e, 0x41, 0x41, 0x41, 0x7e, 0x48, 0x44, 0x42, 0x41,   /* 82 */
	0x3e, 0x41, 0x40, 0x40, 0x3e, 0x01, 0x01, 0x41, 0x3e,   /* 83 */
	0x7f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,   /* 84 */
	0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x3e,   /* 85 */
	0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x22, 0x14, 0x08,   /* 86 */
	0x41, 0x41, 0x41, 0x49, 0x49, 0x49, 0x55, 0x63, 0x41,   /* 87 */
	0x41, 0x41, 0x22, 0x14, 0x08, 0x14, 0x22, 0x41, 0x41,   /* 88 */
	0x41, 0x41, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08, 0x08,   /* 89 */
	0x7f, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7f,   /* 90 */
	0x1e, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1e,   /* 91 */
	0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00,   /* 92 */
	0x3c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x3c,   /* 93 */
	0x3e, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 94 */
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f,   /* 95 */

	0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 96 */
	0x00, 0x00, 0x00, 0x1e, 0x22, 0x42, 0x41, 0x46, 0x3a,   /* 97 */
	0x40, 0x40, 0x40, 0x5c, 0x62, 0x42, 0x42, 0x62, 0x5c,   /* 98 */
	0x00, 0x00, 0x00, 0x3c, 0x42, 0x40, 0x40, 0x42, 0x3c,   /* 99 */
	0x02, 0x02, 0x02, 0x3a, 0x46, 0x42, 0x42, 0x46, 0x3a,   /* 100 */
	0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x7e, 0x40, 0x3e,   /* 101 */
	0x0c, 0x12, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x10, 0x10,   /* 102 */
	0xba, 0x46, 0x42, 0x42, 0x46, 0x3a, 0x02, 0x42, 0x3c,   /* 103 */
	0x40, 0x40, 0x40, 0x58, 0x64, 0x42, 0x42, 0x42, 0x42,   /* 104 */
	0x00, 0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08,   /* 105 */
	0x82, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x42, 0x3c,   /* 106 */
	0x40, 0x40, 0x40, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42,   /* 107 */
	0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,   /* 108 */
	0x00, 0x00, 0x00, 0x76, 0x49, 0x49, 0x49, 0x49, 0x49,   /* 109 */
	0x00, 0x00, 0x00, 0x5c, 0x62, 0x42, 0x42, 0x42, 0x42,   /* 110 */
	0x00, 0x00, 0x00, 0x3c, 0x42, 0x42, 0x42, 0x42, 0x3c,   /* 111 */

	0xdc, 0x62, 0x42, 0x42, 0x62, 0x5c, 0x40, 0x40, 0x40,   /* 112 */
	0xba, 0x46, 0x42, 0x42, 0x46, 0x3a, 0x02, 0x02, 0x02,   /* 113 */
	0x00, 0x00, 0x00, 0x5c, 0x62, 0x40, 0x40, 0x40, 0x40,   /* 114 */
	0x00, 0x00, 0x00, 0x3c, 0x42, 0x30, 0x0c, 0x42, 0x3c,   /* 115 */
	0x00, 0x10, 0x10, 0x7c, 0x10, 0x01, 0x10, 0x12, 0x0c,   /* 116 */
	0x00, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c,   /* 117 */
	0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x28, 0x10,   /* 118 */
	0x00, 0x00, 0x00, 0x41, 0x49, 0x49, 0x49, 0x49, 0x36,   /* 119 */
	0x00, 0x00, 0x00, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42,   /* 120 */
	0xc2, 0x42, 0x42, 0x42, 0x46, 0x3a, 0x02, 0x42, 0x3c,   /* 121 */
	0x00, 0x00, 0x00, 0x7e, 0x04, 0x08, 0x10, 0x20, 0x7e,   /* 122 */
	0x0e, 0x10, 0x10, 0x10, 0x20, 0x10, 0x10, 0x10, 0x0e,   /* 123 */
	0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x10, 0x00,   /* 124 */
	0x38, 0x04, 0x04, 0x04, 0x02, 0x04, 0x04, 0x04, 0x38,   /* 125 */
	0x30, 0x49, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 126 */
	0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f    /* 127 */
};

#endif

